package caiziyou.com.designpattern.observer;

public class WeatherData {

	private float temperature;
	private float pressure;
	private float humidity;
	
	private CurrentConditions conditions;

	public WeatherData() {
		super();
	}

	public WeatherData(float temperature, float pressure, float humidity, CurrentConditions conditions) {
		super();
		this.temperature = temperature;
		this.pressure = pressure;
		this.humidity = humidity;
		this.conditions = conditions;
	}

	public float getTemperature() {
		return temperature;
	}

	public void setTemperature(float temperature) {
		this.temperature = temperature;
	}

	public float getPressure() {
		return pressure;
	}

	public void setPressure(float pressure) {
		this.pressure = pressure;
	}

	public float getHumidity() {
		return humidity;
	}

	public void setHumidity(float humidity) {
		this.humidity = humidity;
	}

	public CurrentConditions getConditions() {
		return conditions;
	}

	public void setConditions(CurrentConditions conditions) {
		this.conditions = conditions;
	}

	@Override
	public String toString() {
		return "WeatherData [temperature=" + temperature + ", pressure=" + pressure + ", humidity=" + humidity
				+ ", conditions=" + conditions + "]";
	}
	
	public void setData(float temperature, float pressure, float humidity) {
		conditions.update(temperature, pressure, humidity);
	}
}
